package mytest

import "fmt"

func mayPanic() {
	slice := []int{1, 2, 3}
	fmt.Println(slice[5]) // 越界访问，会 panic
}

func CallMayPanic() {
	defer func() {
		if r := recover(); r != nil {
			fmt.Println("Recovered from panic:", r)
		}
	}()

	fmt.Println("About to call mayPanic...")
	mayPanic()
	fmt.Println("This line will NOT be executed.")
}
